<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta charset="utf-8" />
	<title>驴妈妈流立方</title>
	<meta name="description" content="overview &amp; stats" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
   	<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrap.min.css" />
	<link rel="stylesheet" href="${rc.contextPath}/assets/font-awesome/4.5.0/css/font-awesome.min.css" />
	<!-- page specific plugin styles -->
	<link rel="stylesheet" href="${rc.contextPath}/assets/css/daterangepicker.min.css" />
	<!-- text fonts -->
	<link rel="stylesheet" href="${rc.contextPath}/assets/css/fonts.googleapis.com.css" />
	<!-- ace styles -->
	<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
	<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace-skins.min.css" />
	<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace-rtl.min.css" />
	<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrap-datetimepicker.min.css" />
	<!-- ace settings handler -->
	<script src="${rc.contextPath}/assets/js/ace-extra.min.js"></script>
		

</head>
	<body class="skin-2" style="background-color: #FFF;">
		<div class="page-content">
			<div class="row">
				<div class="col-xs-12">
				
					<div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
						
						<div class="col-xs-2">
							<div class="dataTables_length">
								<label>开始时间
									<input type="text" class="form-control datetimepicker" id="startTime" name="startTime" placeholder="开始时间">
								</label>
							</div>
						</div>
						<div class="col-xs-2">
							<div class="dataTables_length">
								<label>结束时间
									<input type="text" class="form-control datetimepicker" id="endTime" name="endTime" placeholder="结束时间">
								</label>
							</div>
						</div>
						<div class="col-xs-2">
							<div class="dataTables_length">
								<button type="button" class="btn btn-pink btn-sm" id="generateBtn">
									<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
									查询
								</button>
								&nbsp;&nbsp; <span style="color: red;" id="tishi" hidden="true"></span>
							</div>
						</div>
						<br>
						<br>
						<hr>
						<table id="simple-table" class="table table-striped table-bordered table-hover" hidden="true">
								<thead>
									<tr>
										<th>开始时间</th>
										<th>截止时间</th>
										<th>获取验证码按钮次数</th>
										<th>立即领取按钮次数</th>
										<th>红包活动页面次数</th>
										<th>弹幕页面次数</th>
										<th>我的红包页面次数</th>
										<th>吐槽次数</th>
									</tr>
								</thead>

								<tbody>
								
									<tr id="data">
										
									
									</tr>
							
								</tbody>
							</table>
					</div>
				</div>
			</div>
		</div>
		<script src="${rc.contextPath}/assets/js/jquery-2.1.4.min.js"></script>
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='${rc.contextPath}/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="${rc.contextPath}/assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->
		<script src="${rc.contextPath}/assets/js/jquery-ui.min.js"></script>
		<script src="${rc.contextPath}/assets/js/jquery.ui.touch-punch.min.js"></script>

		<!-- ace scripts -->
		<script src="${rc.contextPath}/assets/js/ace-elements.min.js"></script>
		<script src="${rc.contextPath}/assets/js/ace.min.js"></script>
		<!-- user scripts -->
		<script src="${rc.contextPath}/assets/js/user/base.js"></script>
		<script src="${rc.contextPath}/assets/js/moment.min.js"></script>
		<script src="${rc.contextPath}/assets/js/bootstrap-datetimepicker.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function(event) {
				var options = {
						format:'YYYY-MM-DD HH:mm:ss'
				}
				$('.datetimepicker').datetimepicker(options).next().on(ace.click_event, function(){
					$(this).prev().focus();
				});			
				$("#generateBtn").click(function(){
					$("table").hide();
					var stime=$("#startTime").val();
					var etime=$("#endTime").val();
					if(stime==""||etime==""||Date.parse(etime)<=Date.parse(stime)){
						$("#tishi").show();
						$("#tishi").text("请输入正确日期");
					}else{
						$("#tishi").hide();
						$.ajax({
							data: "startTime="+stime+"&endTime="+etime,
							  url: "${rc.contextPath}/manGod/ajaxByDate",
							  success: function(data){
							    if(data==null||data==""){
							    	window.location.href="${rc.contextPath}/page/404";
							    	return;
							    }else{
							    	$("table").show();
							    	$("#data").empty();
							    	var html="<td>"+stime+"</td>"+"<td>"+etime+"</td>"+"<td>"+data.obtainAuthcode+"</td>"
							    	+"<td>"+data.getHb+"</td>"+"<td>"+data.hbActivityPage+"</td>"+"<td>"+data.barragePage+"</td>"+
							    	"<td>"+data.myHb+"</td>"+"<td>"+data.sendTaunt+"</td>";
							    	$("#data").append(html);
							    }
							  }
							});
					}
					
				});
			
			});
	</script>
	</body>
</html>